<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>排序</title>
    <script src="../angular.js"></script>
</head>
<body>
<div ng-app="gg" ng-controller="ctrl">
    <!-- true 为降序， false 为升序 ， 默认为false-->
    {{data | orderBy : 'id' : true}}
    <hr />
    {{data | orderBy : 'click' : true}}
    <hr />

    <!-- 匹配数据任何字段 含 1 的-->
    <!-- true 为完全匹配 ===  -->
    {{data | filter : 100 : true}}
</div>

<script>
    var mod = angular.module('gg', []);
    mod.controller('ctrl', ['$scope', function ($scope) {

        $scope.data = [
            {id: 1 ,click : 100, title : '美文'},
            {id: 2 ,click : 80, title : '英语'},
            {id: 3 ,click : 150, title : '高数'}
        ]
    }])
</script>
</body>
</html>

